\ProvidesPackage{scigeneral}

% -Graphics
\usepackage{graphicx}
\usepackage{tikz}

% -math settings
% --general settings
% \everymath{\displaystyle}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{bm} % For bold face math symbol like vectors, matrix

% \varliminf, \varlimsup
\usepackage{mathtools} % add on 180709


% -Special symbols
% --Vertical symbol
\newcommand\mi{\mathrm{i}}
\newcommand\mj{\mathrm{j}}
\newcommand\me{\mathrm{e}}
\newcommand\TL{\mathrm{TL}}
\usepackage{upgreek}
\newcommand\pri{^\prime}

% \DeclareMathOperator\dif{d\!} % redundent
% --Operators
\DeclareMathOperator{\sinc}{sinc}
\DeclareMathOperator{\arccosh}{arccosh}
\DeclareMathOperator{\arcsinh}{arcsinh}

\usepackage{amsfonts}
\newcommand{\R}{\ensuremath{\mathbb{R}}}
\newcommand{\CC}{\ensuremath{\mathbb{C}}}
% \renewcommand{\C}{\ensuremath{\mathbb{C}}}
\newcommand{\Z}{\ensuremath{\mathbb{Z}}}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\F}{\mathbb{F}}
\newcommand{\W}{\mathbb{W}}

\newcommand{\parabin}{\mathbin{\|}}
\newcommand{\parabins}{\mathbin{\!/\mkern-5mu/\!}}


% text type
\newcommand\tc{\text{c}}
\newcommand\Tsz{T_{60}}
\newcommand\tbs{\textbackslash}
\newcommand\upB{\mathrm{B}}
\newcommand\upC{\mathrm{C}}
\newcommand\upH{\mathrm{H}}
\newcommand\upI{\mathrm{I}}
\newcommand\upJ{\mathrm{J}}
\newcommand\upK{\mathrm{K}}
\newcommand\upN{\mathrm{N}}
\newcommand\upY{\mathrm{Y}}
% subscriptive text
\newcommand\st[1]{_\text{#1}}

\newcommand\mtr{^\intercal}

% -- simplify some notations
\newcommand\due{\because}
\newcommand\thus{\therefore}
% \newcommand\map{\rightarrow}
\newcommand\ito{\leftarrow}
% \newcommand\iff{\Leftrightarrow}
\newcommand\imp{\Longrightarrow}
\newcommand\iimp{\Longleftarrow}
\newcommand\contra{\qty(\to\ito)}
\usepackage{extarrows}

% -- overwrites
\let\geq\geqslant
\let\leq\leqslant
\let\ngeq\ngeqslant
\let\nleq\nleqslant
\let\succeq\succcurlyeq
\let\preceq\preccurlyeq
\let\npreceq\npreccurlyeq
\let\nsucceq\nsucccurlyeq
\let\:\colon
\let\oldeps\epsilon
\let\eps\varepsilon
\let\oldphi\phi
\let\phi\varphi
\let\oldemptyset\emptyset
\let\emptyset\varnothing



% celsius degree
\usepackage{textcomp}
\def\celsius{\ensuremath{^\circ\hspace{-0.09em}\mathrm{C}}}

% div symbol
\let\olddiv\div
% \usepackage{xparse} % Need by the package physics
\usepackage{physics}
\newcommand\mb[1]{\mathbf{#1}}

\usepackage{esint} % use \oiint

% Widebar
\makeatletter
\let\save@mathaccent\mathaccent
\newcommand*\if@single[3]{%
  \setbox0\hbox{${\mathaccent"0362{#1}}^H$}%
  \setbox2\hbox{${\mathaccent"0362{\kern0pt#1}}^H$}%
  \ifdim\ht0=\ht2 #3\else #2\fi
  }
%The bar will be moved to the right by a half of \macc@kerna, which is computed by amsmath:
\newcommand*\rel@kern[1]{\kern#1\dimexpr\macc@kerna}
%If there's a superscript following the bar, then no negative kern may follow the bar;
%an additional {} makes sure that the superscript is high enough in this case:
\newcommand*\widebar[1]{\@ifnextchar^{{\wide@bar{#1}{0}}}{\wide@bar{#1}{1}}}
%Use a separate algorithm for single symbols:
\newcommand*\wide@bar[2]{\if@single{#1}{\wide@bar@{#1}{#2}{1}}{\wide@bar@{#1}{#2}{2}}}
\newcommand*\wide@bar@[3]{%
  \begingroup
  \def\mathaccent##1##2{%
%Enable nesting of accents:
    \let\mathaccent\save@mathaccent
%If there's more than a single symbol, use the first character instead (see below):
    \if#32 \let\macc@nucleus\first@char \fi
%Determine the italic correction:
    \setbox\z@\hbox{$\macc@style{\macc@nucleus}_{}$}%
    \setbox\tw@\hbox{$\macc@style{\macc@nucleus}{}_{}$}%
    \dimen@\wd\tw@
    \advance\dimen@-\wd\z@
%Now \dimen@ is the italic correction of the symbol.
    \divide\dimen@ 3
    \@tempdima\wd\tw@
    \advance\@tempdima-\scriptspace
%Now \@tempdima is the width of the symbol.
    \divide\@tempdima 10
    \advance\dimen@-\@tempdima
%Now \dimen@ = (italic correction / 3) - (Breite / 10)
    \ifdim\dimen@>\z@ \dimen@0pt\fi
%The bar will be shortened in the case \dimen@<0 !
    \rel@kern{0.6}\kern-\dimen@
    \if#31
      \overline{\rel@kern{-0.6}\kern\dimen@\macc@nucleus\rel@kern{0.4}\kern\dimen@}%
      \advance\dimen@0.4\dimexpr\macc@kerna
%Place the combined final kern (-\dimen@) if it is >0 or if a superscript follows:
      \let\final@kern#2%
      \ifdim\dimen@<\z@ \let\final@kern1\fi
      \if\final@kern1 \kern-\dimen@\fi
    \else
      \overline{\rel@kern{-0.6}\kern\dimen@#1}%
    \fi
  }%
  \macc@depth\@ne
  \let\math@bgroup\@empty \let\math@egroup\macc@set@skewchar
  \mathsurround\z@ \frozen@everymath{\mathgroup\macc@group\relax}%
  \macc@set@skewchar\relax
  \let\mathaccentV\macc@nested@a
%The following initialises \macc@kerna and calls \mathaccent:
  \if#31
    \macc@nested@a\relax111{#1}%
  \else
%If the argument consists of more than one symbol, and if the first token is
%a letter, use that letter for the computations:
    \def\gobble@till@marker##1\endmarker{}%
    \futurelet\first@char\gobble@till@marker#1\endmarker
    \ifcat\noexpand\first@char A\else
      \def\first@char{}%
    \fi
    \macc@nested@a\relax111{\first@char}%
  \fi
  \endgroup
}
\makeatother


% --special notations
\newcommand\degree{^\circ}
% contradiction symbol
\newcommand{\contradict}{
\begin{tikzpicture}[rotate=45,x=0.5ex,y=0.5ex]
\draw[line width=.2ex] (0,2) -- (3,2) (0,1) -- (3,1) (1,3) -- (1,0) (2,3) -- (2,0);
\end{tikzpicture}
}
\newcommand\RHS{\mathrm{RHS}}
% \def\contra{\tikz[baseline, x=0.22em, y=0.22em, line width=0.032em]\draw (0,2.83)--(2.83,0) (0.71,3.54)--(3.54,0.71) (0,0.71)--(2.83,3.54) (0.71,0)--(3.54,2.83);}

% --other
% \usepackage{txfonts} % conflict with pkg bm, amsmath, physcis and so on: \bm, \vb, ..

\usepackage{siunitx} % conflict with pkg physics: \vb


% -Glossaries
% \usepackage[symbols, nogroupskip]{glossaries-extra}
\usepackage[symbols,sort=none,nogroupskip]{glossaries-extra}


% -Page setup
\usepackage{hyperref}
\hypersetup{
	colorlinks		=	true,
	bookmarks		=	true,
	bookmarksopen	=	true,
	pdfpagemode		=	FullScreen,
	pdfstartview	=	Fit,
	pdftitle		=	{The Principle of Acoustics},
	pdfauthor		=	{Jiaxin Zhong}
}


% provides the environment outline
\usepackage{outlines}

% generates dummy text
\usepackage{lipsum}

% animation
\usepackage{animate}
\usepackage{xmpmulti}


% the table

\usepackage{booktabs}
\usepackage{threeparttable}
\usepackage{multirow}

\usepackage{xcolor}


% insert code block
\usepackage{listings}
\lstset{
	basicstyle=\sffamily,
	keywordstyle=\bfseries\color[RGB]{40,40,255},
	commentstyle=\rmfamily\itshape\color[RGB]{0,96,96},
	stringstyle=\ttfamily\color[RGB]{128,0,0},
	numbers=left,
	numberstyle=\footnotesize\color{darkgray},
	frame=none, % 不显示背景边框
	backgroundcolor=\color[RGB]{245,245,244},
	columns=flexible
}


